package com.itheima.dao;

import com.itheima.pojo.Permission;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @author benben278
 * @create 2022-03-18 20:47
 */
@Mapper
public interface PermissionDao {
    //根据角色id查询关联的权限
    @Select("select  p.*  from t_permission p ,t_role_permission rp where p.id = rp.permission_id and rp.role_id = #{roleId}")
    Set<Permission> findByRoleId(int roleId);
}
